# Maintainer: Alexey Pavlov <Alexpux@gmail.com>

pkgname=docbook-xsl
pkgver=1.79.2
pkgrel=1
pkgdesc='XML stylesheets for Docbook-xml transformations'
arch=('any')
license=('custom')
url='https://docbook.sourceforge.io/'
depends=('libxml2' 'libxslt' 'docbook-xml')
install="$pkgname.install"
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/docbook/xslt10-stylesheets/releases/download/release%2F$pkgver/${pkgname}-nons-${pkgver}.tar.gz)
sha256sums=('f89425b44e48aad24319a2f0d38e0cb6059fdc7dbaf31787c8346c748175ca8e')

package() {
  cd ${srcdir}/${pkgname}-nons-${pkgver}

  _pkgroot=${pkgdir}/usr/share/xml/docbook/xsl-stylesheets-${pkgver}

  install -dm755 ${_pkgroot}
  install -m644 VERSION VERSION.xsl ${_pkgroot}

  for fn in assembly common eclipse epub epub3 fo highlighting html htmlhelp javahelp lib \
      manpages params profiling roundtrip template website xhtml xhtml-1_1 xhtml5; do
    install -dm755 ${_pkgroot}/${fn}
    install -m644 ${fn}/*.{xml,xsl,dtd,ent} ${_pkgroot}/${fn} || true  # ignore missing files
  done

  install -dm755 ${pkgdir}/etc/xml
  install -Dm644 COPYING ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
}
